use dioxus::prelude::*;

#[derive(Debug, Clone, Props, PartialEq)]
pub struct ClearProps {
    targets: Vec<Signal<String>>,
}

#[component]
pub fn Clear(props: ClearProps) -> Element {
    rsx! {
        button {
            onclick:move |_|  {
                for target in &props.targets {

                                    target.clone().set(String::new());
                                }
            },
            class: "inline-flex items-center justify-center gap-2 whitespace-nowrap text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [\u{0026}amp;_svg]:pointer-events-none [\u{0026}amp;_svg]:size-4 [\u{0026}amp;_svg]:shrink-0 border hover:bg-accent hover:text-accent-foreground h-10 border-gray-20 hover:border-gray-300 px-6 py-2 rounded-xl bg-transparent",
            "Clear"
        }
    }
}
